package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-04-19
 * Time: 20:09
 */
class Animal {
    public String name;
    public int age;
}
class Dog extends Animal{

    public void eat() {
        System.out.println(this.name+"正在吃");
    }
    public void bark() {
        System.out.println(this.name+"正在汪汪汪");
    }
}
class Cat extends Animal{

    public void eat() {
        System.out.println(this.name+"正在吃饭！");
    }
    public void mimi() {
        System.out.println(this.name+"正在喵喵喵");
    }

}
public class TestDemo {
    public static void main(String[] args) {
        Dog dog = new  Dog();
        dog.age = 10;
        dog.name = "小灰灰";
        dog.eat();
        dog.bark();
        System.out.println("==================");
        Cat cat = new Cat();
        cat.age = 10;
        cat.name = "小猫猫";
        cat.eat();
        cat.mimi();
    }
}
